﻿using CPPEI.WebApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.EBS.WebApi
{
    [CPPEI.WebApi.PostAction("EBS", "Unregister", "1.0")]
    public class UnregisterAction : BaseAction<UnregisterParams, UnregisterResult>
    {
        protected override ActionResult<UnregisterResult> OnExecute(ActionContext context, SysParameters sysParams, UnregisterParams opParams)
        {
            UnregisterResult actResult = new UnregisterResult();
            Domain.Services.RegisterService service = new Domain.Services.RegisterService();

            ServiceResult serResult = service.Unregister(opParams.AppId, opParams.AppToken, opParams.Namespace, opParams.Event);

            return new ActionResult<UnregisterResult>(serResult.IsSuccess, serResult.ErrorCode, serResult.Message, null);
        }
    }

    public class UnregisterParams
    {
        public Guid AppId{get;set;}
        public string AppToken{get;set;}
        public string Namespace{get;set;}
        public string Event{get;set;}
    }

    public class UnregisterResult
    {

    }
}
